import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:grocery_app_demo/pages/drawer/drawer.dart';
import 'package:grocery_app_demo/routes/app_routes.dart';
import 'package:grocery_app_demo/widgets/gap.dart';

import 'controller.dart';

class PurchaseMainPage extends GetView<PurchaseMainController> {
  const PurchaseMainPage({super.key});

  @override
  Widget build(BuildContext context) {
    Get.put(PurchaseMainController());

    return Scaffold(
      appBar: AppBar(
        title: Text('采购管理'.tr),
      ),
      drawer: const CommonDrawer(),
      body: ListView(
        children: [
          ListTile(
            leading: const Icon(Icons.shopping_cart_outlined),
            title: Text('需求汇总'.tr),
            onTap: () => Get.toNamed(AppRoutes.waitForPurchaseGoods),
          ),
          line,
          ListTile(
            leading: const Icon(Icons.task_alt_outlined),
            title: Text('采购任务'.tr),
          ),
          line,
          ListTile(
            leading: const Icon(Icons.payment_outlined),
            title: Text('采购付款'.tr),
          ),
          line,
        ],
      ),
      floatingActionButton: FloatingActionButton.extended(
        tooltip: '新建采购单'.tr,
        icon: const Icon(Icons.add),
        onPressed: () => Get.toNamed(AppRoutes.createPurchase),
        label: Text('新建采购单'.tr),
      ),
    );
  }
}
